package com.statistics.cloudpower.dao;

import com.statistics.cloudpower.entity.TblEquipment;
import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.data.jpa.repository.Query;
import org.springframework.stereotype.Repository;

import java.util.List;

/**
 * Created by studio on 2017/4/6.
 */

@Repository
public interface TblEquipmentDAO extends JpaRepository<TblEquipment,Integer> {

    @Query(value = "select * from tbl_equipment where type = ? limit ?,?",nativeQuery = true)
    public List<TblEquipment> findPageBySql(String type, long start, long size);

    @Query(value = "select count(*) from tbl_equipment where type = ? ",nativeQuery = true)
    public Long count(String type);
}
